How to make this multiple conditional if else block into shorter syntax - javascript

welcome to shbcf.ru